package com.dcy.composite;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * @Author：dcy
 * @Description:
 * @Date: 2021/1/22 9:45
 */
@Getter
@Setter
@ToString
public abstract class OrganizationComponent {

    /**
     * 名字
     */
    private String name;

    /**
     * 描述
     */
    private String des;

    public OrganizationComponent(String name, String des) {
        this.name = name;
        this.des = des;
    }

    protected void add(OrganizationComponent organizationComponent) {
        // 默认实现
        throw new UnsupportedOperationException();
    }

    protected void remove(OrganizationComponent organizationComponent) {
        // 默认实现
        throw new UnsupportedOperationException();
    }

    /**
     * 子类都需要实现
     */
    protected abstract void print();
}
